package com.dt76.smallloanbackenduser.remote.afterloan;


import com.dt76.smallloanbackenduser.pojo.afterloan.RepaymentCommitInfo;
import com.dt76.smallloanbackenduser.pojo.afterloan.RepaymentInfo;
import com.dt76.smallloanbackenduser.pojo.afterloan.RepaymentQualification;
import com.dt76.smallloanbackenduser.utils.PageResult;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "smallloan-backend-service")
public interface RepaymentRemote {

    @PostMapping(value = "/repayment/getPageList", consumes = "application/json")
    public PageResult getPageList(@RequestBody RepaymentQualification q, @RequestParam("page") Integer page, @RequestParam("size") Integer size);

    @RequestMapping("/repayment/getById")
    public List<RepaymentInfo> getById(@RequestParam("id") Integer id);

    @PostMapping(value = "/repayment/commitRepaymentConfirm", consumes = "application/json")
    public Map<String, Object> commitRepaymentConfirm(@RequestBody RepaymentCommitInfo q, @RequestParam("repaymentId") Integer repaymentId, @RequestParam("loanId") Integer loanId);

}
